import React from "react"
import { createStore, applyMiddleware } from 'redux';
import { Provider } from "react-redux";
import { Card } from 'antd';
import redux from "./reduxThunk01/redux"
import thunk from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction'; //引入谷歌浏览器 Redux 插件


import ReduxThunk0101 from "./reduxThunk01/reduxThunk01-01"

class ReduxThunk01 extends React.Component {
    constructor(props) {
        super(props);
        this.store = createStore(redux, {}, composeWithDevTools(applyMiddleware(thunk))) //使用谷歌浏览器 Redux 插件
        // this.store = createStore(redux, {number:999}, applyMiddleware(logger))  //连接redux
        //第二个参数 就是state 也可以从ajax发过来

    }
    render() {
        return (
            <Provider store={this.store}>
                <Card title="redux-thunk  处理异步" bordered={false}>
                    <ReduxThunk0101 />

                </Card>
            </Provider>
        )
    }
}
export default ReduxThunk01